package com.vpen.block.controller;

import com.vpen.block.model.PlanDTO;
import com.vpen.block.task.ProducerAndConsumerService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @version: 1.0
 * @author: Vpen
 * @date: 2021/11/21 0:24
 * @content:
 */
@RestController
@RequestMapping("/record")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class PlanController {
    private final ProducerAndConsumerService service;
    @GetMapping
    public void save(PlanDTO planDTO){
        service.startTask(planDTO);
    }

    @GetMapping("/save")
    public void save2(PlanDTO planDTO){
        service.startTask2(planDTO);
    }

}
